package app.netant.book.bxwx;

import cn.lily.com.enviroment.Enviroment;
import app.netant.book.base.BaseDetail;
import app.netant.book.base.BaseEntity;
import app.netant.book.base.BasePage;
import app.netant.book.base.BaseRoot;

public class BxwxRoot extends BaseRoot {
	
	public BxwxRoot(){
		this.homeUrl = "http://zhannei.baidu.com/cse/search?q=%E5%A5%87%E5%B9%BB&p=0&s=756366825763876368&nsid=";
		this.pageUrl = "http://zhannei.baidu.com/cse/search?q=%E5%A5%87%E5%B9%BB&p=";
		this.tableKey = "bxwx";
	}

	@Override
	public String buildUrl(int pageIdx) {
		return this.pageUrl + pageIdx+"&s=756366825763876368&nsid=";
	}

	@Override
	public BasePage buildPage(String url) {
		return new BxwxPage(url);
	}

	@Override
	public BaseDetail buildDetail(String url) {
		return new BxwxDetail(url);
	}

	@Override
	public BaseEntity buildEntity() {
		return new BxwxEntity();
	}
	
	@Override
	public void afterEntity(BaseEntity entity) {
		
	}
	
	public static void main(String[] args) {
		
		Enviroment.createEnv();
		Enviroment.getEnv().getLogBean().beginLog();
		
		BxwxRoot root = new BxwxRoot();
		//root.analyse(74);
		//root.excepCycle();
	}


	
}
